package com.naizhuai.network.apistore;

import com.naizhuai.Model.db.user.PersonUserBean;
import com.naizhuai.network.Config;
import com.naizhuai.network.entity.ResultResponse;
import com.naizhuai.ui.entity.mainbusiness.TargetMainBean;
import com.naizhuai.ui.entity.mainbusiness.TargetDetailsBean;
import com.naizhuai.ui.entity.mainbusiness.TargetDetailsReplayBean;
import com.naizhuai.ui.entity.mainbusiness.TargetSearchLimitedBack;

import java.util.List;
import java.util.Map;

import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by code_han on 2018/4/10.
 * 目标页面的网络接口调用
 */
public interface TargetDataRequest {

    /*
    查
     */
    //根据公司id获取目标的列表
    @GET(Config.TARGET_GET_LIST)
    Observable<ResultResponse<TargetMainBean>> getTargetListByComId(@Query("companyId") String companyId);

    //获取目标详情信息
    @GET(Config.TARGET_GET_ITEM_DETAILS)
    Observable<ResultResponse<TargetDetailsBean>> getTargetDetailsByGoalId(@Query("goalId") String companyId);

    //获取目标复盘页面信息
    @GET(Config.TARGET_GET_REVIEW_DETAILS)
    Observable<ResultResponse<TargetDetailsReplayBean>> getTargetReviewByGoalId(@Query("goalId") String companyId);

    //搜索获取符合条件的部门？个人信息
    @GET(Config.TARGET_SEARCH_USER_DETAILS)
    Observable<ResultResponse<TargetSearchLimitedBack>> getSearchUserDetails(@QueryMap Map<String,String> searchMap);

    //获取目标牵头人的可选范围列表
    @GET(Config.TARGET_GET_MANAGER_CHOSEN_FIELDS)
    Observable<ResultResponse<List<PersonUserBean>>> getManagerChosenFields(@Query("companyId") String companyId,@Query("departmentId") String departmentId,@Query("type") String type);

    /*
    添加
     */
    //添加新的目标
    @FormUrlEncoded
    @POST(Config.TARGET_ADD_NEW)
    Observable<ResultResponse<String>> addNewTarget(@FieldMap Map<String,String> newTargetBean);



    /*
    删除
     */
    //根据公司id与团队id删除某个团队（开除/离职等等，在操作的时候需要判断操作人的权限）
    @FormUrlEncoded
    @POST(Config.DELETE_TEAM_BY_IDS)
    Observable<ResultResponse<String>> deleteTeamFromCompanyByIds(@Field("companyId") String companyId, @Field("departmentId") String teamId);

    /*
    修改
     */
    //目标复盘上报接口信息
    @FormUrlEncoded
    @POST(Config.TARGET_POST_REVIEW_MESSAGE)
    Observable<ResultResponse<String>> submitReviewMessage(@FieldMap Map<String,String> submitMessage);

}
